<?php

class Social_Controller_Browse_Facebook_Oauth2callback
{

	function execute($request)
	{
		$adapter = Nuo::getObject('social/adapter/facebook');

		$clientApi = $adapter -> getClientApi();

		if (isset($_REQUEST['code']))
		{
			$access_token = $clientApi -> getUserAccessToken();
			$clientApi -> setAccessToken($access_token);
			$profile = $clientApi -> api('/me');

			var_dump($profile);

			exit ;
		}
	}

}
